Skip to content

Conversation

kfranqueiro
Copy link
Contributor

This fixes instances where we had specified the wrong language-... class in <pre><code class="...">, causing highlight.js to highlight code incorrectly.

(Originally fixed/reported in #4611, which is being split up and closed)

Copy link

netlify bot commented Sep 18, 2025

Deploy Preview for wcag2 ready!

Name Link
🔨 Latest commit 785f92c
🔍 Latest deploy log https://app.netlify.com/projects/wcag2/deploys/68cc65566348fc0008b38610
😎 Deploy Preview https://deploy-preview-4624--wcag2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

<h4>The JavaScript</h4>

<pre xml:space="preserve"><code class="language-javascript">&lt;script&gt;
<pre xml:space="preserve"><code class="language-html">&lt;script&gt;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this be better as language-javascript? Seems there is much more JS than HTML

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What matters isn't how much there is, but that there's a <script> tag around it. This inherently makes this an HTML block.

Same for instances of CSS surrounded by <style>. The xml language support is capable of understanding JS and CSS within appropriate contexts, but the reverse is not true.

@kfranqueiro kfranqueiro merged commit ad4542f into main Sep 24, 2025
7 checks passed
@kfranqueiro kfranqueiro deleted the kgf-fix-hljs-overrides branch September 24, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants